package travelDream.beans;

import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import traveldream.ejb.interfaces.*;
import traveldream.ejb.DTO.*;

@ManagedBean(name = "RegistrationManaged")
@RequestScoped
public class RegistrationManaged {

	@EJB
	private registrationBeanLocal registrationBeanLocal;
	
	private RegistrationDTO reDTO;
	
	public RegistrationManaged(){
		reDTO = new RegistrationDTO();
	}
	
	public String register(){
		registrationBeanLocal.register(reDTO);
		return "/index.xhtml?faces-redirect=true";
	}

	public registrationBeanLocal getRegistrationBeanLocal() {
		return registrationBeanLocal;
	}

	public void setRegistrationBeanLocal(registrationBeanLocal registrationBeanLocal) {
		this.registrationBeanLocal = registrationBeanLocal;
	}

	public RegistrationDTO getReDTO() {
		return reDTO;
	}

	public void setReDTO(RegistrationDTO reDTO) {
		this.reDTO = reDTO;
	}
}
